import request from '@/axios'
import type { ListParams, Response } from '@/api/api'

export interface Row {
  id?: number
  name: String
  real_name: string
  password: string
  mobile: string
  user_name: string
  address: string
  remark: string
}

// 客户列表
export const getListApi = (data: ListParams): Promise<Response<Row>> => {
  return request.post({ url: '/user/list', data })
}
// 客户列表新增
export const createApi = (data: Partial<Row>): Promise<IResponse> => {
  return request.post({ url: '/user/create', data })
}
// 客户修改
export const modifyApi = (data: Partial<Row>): Promise<IResponse> => {
  return request.post({ url: '/user/modify', data })
}
// 客户列表删除
export const delApi = (data: { id: string }): Promise<IResponse> => {
  return request.post({ url: '/user/del', data })
}
// 客户列表修改状态
export const modifyStatusApi = (data: { id: string; status: string }): Promise<IResponse> => {
  return request.post({ url: '/user/modify_status', data })
}
